package com.zzy.state;
import java.util.HashMap;
import java.util.Random;
public class NPC {
	private State statement;
    private int Action;
    private int statenumber;
    private HashMap<Integer, State> StatementSet = new HashMap<Integer, State>();
    private HashMap<Integer, Action> ActionSet = new HashMap<Integer, Action>();
    public HashMap<Integer, Action> getActionSet() {
        return ActionSet;
    }
    public void setActionSet(HashMap<Integer, Action> actionSet) {
        ActionSet = actionSet;
    }
    public int getStatenumber() {
        return statenumber;
    }
    public void setStatenumber(int statenumber) {
        this.statenumber = statenumber;
    }
    public HashMap<Integer, State> getStatementSet() {
        return StatementSet;
    }
    public void setStatementSet(HashMap<Integer, State> statementSet) {
        StatementSet = statementSet;
    }
    public NPC() {
        ActionSet.put(1, new action1());
        ActionSet.put(2, new action2());
        ActionSet.put(3, new action3());
        ActionSet.put(4, new action4());
        ActionSet.put(5, new action5());
        StatementSet.put(1, new Happy());
        StatementSet.put(2, new Sad());
        StatementSet.put(3, new Angry());
        int t = new Random(7).nextInt(999);
        int k = new Random(t).nextInt(2) + 1;
        this.statenumber = k;
        statement = StatementSet.get(statenumber);
    }
    public State getStatement() {
        return statement;
    }
    public void setStatement(State statement) {
        this.statement = statement;
    }
    public int getAction() {
        return Action;
    }
    public void setAction(int action) {
        Action = action;
    }
    public void Handle() {
        statement.Handle1(this);
    }
	

}
